
i = 1
s = '0'
while True:
    s += str(i)
    if len(s) > 1000000:
        break
    i += 1

print s[12]
d = s[1], s[10], s[100], s[1000], s[10000], s[100000], s[1000000]
print d
print reduce(lambda a, b : a * int(b), d, 1)